# -*- coding: utf-8 -*-
import sys
import io

class UserData:
    def __init__(self, area):  # 构造函数
        self.area = area

    def process_data(self):  # 类的方法
        # 提取市的名称
        if "自治区" in self.area:
            # 去掉“自治区”及其前面的部分
            city_part = self.area.split("自治区")[1]
        elif "省" in self.area:
            # 去掉“省”及其前面的部分
            city_part = self.area.split("省")[1]
        else:
            city_part = self.area

        # 从剩余部分中提取市的名称
        if "市辖区" in city_part:
            city = city_part.split("市辖区")[0] + "市"
        elif "市" in city_part:
            city = city_part.split("市")[0] + "市"
        else:
            city = "未知市"

        return city

if __name__ == "__main__":
    # 从命令行参数中获取字符串数据
    area = sys.argv[1]
    user_data = UserData(area)
    result = user_data.process_data()
    # 设置标准输出的编码为 UTF-8
    sys.stdout = io.TextIOWrapper(sys.stdout.buffer, encoding='utf-8')
    # 将结果输出到标准输出
    print(result)